The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
Changes 08
MANIFEST.SKIP 01
META.yml 3739
Makefile.PL 811
lib/Data/Serializer/JSON.pm 12
lib/Data/Serializer.pm 34
t/05-Encryption.t 01
7 files changed (This is a version diff) 4966
@@ -1,5 +1,13 @@
 Revision history for Perl extension Data::Serializer
 
+0.51  Wed Dec  29 2010
+	- Modified JSON deserializer to handle corrupt input (Bug#63259)
+		Thanks to neil.whelchel@gmail.com for report and patch
+
+0.50  Wed Dec  29 2010
+	- Modified dedigest function to armor against corrupt input values (Bug#63258)
+		Thanks to neil.whelchel@gmail.com for report and patch
+
 0.49  Tue Apr  15 2009
 	- Modified XML::Simple serializer to support options
 		patch supplied by John Alden <john_a_alden@hotmail.com>
@@ -5,3 +5,4 @@
 ^Build$
 ^_build/
 ^testout/
+^MYMETA.yml$
@@ -1,45 +1,23 @@
 ---
-name: Data-Serializer
-version: 0.49
+abstract: 'Modules that serialize data structures'
 author:
-  - Neil Neely (neil@neely.cx)
-abstract: Modules that serialize data structures
-license: perl
-resources:
-  license: ~
-requires:
-  AutoLoader: 0
-  Data::Dumper: 2.08
-  Digest::SHA: 0
-  Exporter: 0
-  IO::File: 0
+  - 'Neil Neely (neil@neely.cx)'
 build_requires:
   File::Spec: 0
   IO::File: 0
   Test::More: 0
-recommends:
-  Compress::PPMd: 0
-  Compress::Zlib: 0
-  Config::General: 0
-  Crypt::Blowfish: 0
-  Crypt::CBC: 0
-  Data::Denter: 0
-  Data::Taxi: 0
-  FreezeThaw: 0
-  JSON: 0
-  JSON::Syck: 0
-  JSON::XS: 0
-  MIME::Base64: 0
-  PHP::Serialization: 0
-  Storable: 0
-  XML::Dumper: 0
-  XML::Simple: 0
-  YAML: 0
-  YAML::Syck: 0
+configure_requires:
+  Module::Build: 0.36
+generated_by: 'Module::Build version 0.3607'
+license: perl
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4
+name: Data-Serializer
 provides:
   Data::Serializer:
     file: lib/Data/Serializer.pm
-    version: 0.49
+    version: 0.51
   Data::Serializer::Config::General:
     file: lib/Data/Serializer/Config/General.pm
     version: 0.02
@@ -82,7 +60,31 @@ provides:
   Data::Serializer::YAML::Syck:
     file: lib/Data/Serializer/YAML/Syck.pm
     version: 0.02
-generated_by: Module::Build version 0.31012
-meta-spec:
-  url: http://module-build.sourceforge.net/META-spec-v1.2.html
-  version: 1.2
+recommends:
+  Compress::PPMd: 0
+  Compress::Zlib: 0
+  Config::General: 0
+  Crypt::Blowfish: 0
+  Crypt::CBC: 0
+  Data::Denter: 0
+  Data::Taxi: 0
+  FreezeThaw: 0
+  JSON: 0
+  JSON::Syck: 0
+  JSON::XS: 0
+  MIME::Base64: 0
+  PHP::Serialization: 0
+  Storable: 0
+  XML::Dumper: 0
+  XML::Simple: 0
+  YAML: 0
+  YAML::Syck: 0
+requires:
+  AutoLoader: 0
+  Data::Dumper: 2.08
+  Digest::SHA: 0
+  Exporter: 0
+  IO::File: 0
+resources:
+  license: http://dev.perl.org/licenses/
+version: 0.51
@@ -1,31 +1,34 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.31012
-    
+# Note: this file was auto-generated by Module::Build::Compat version 0.3607
+
     unless (eval "use Module::Build::Compat 0.02; 1" ) {
       print "This module requires Module::Build to install itself.\n";
-      
+
       require ExtUtils::MakeMaker;
       my $yn = ExtUtils::MakeMaker::prompt
 	('  Install Module::Build now from CPAN?', 'y');
-      
+
       unless ($yn =~ /^y/i) {
 	die " *** Cannot install without Module::Build.  Exiting ...\n";
       }
-      
+
       require Cwd;
       require File::Spec;
       require CPAN;
-      
+
       # Save this 'cause CPAN will chdir all over the place.
       my $cwd = Cwd::cwd();
-      
+
       CPAN::Shell->install('Module::Build::Compat');
       CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
 	or die "Couldn't install Module::Build, giving up.\n";
-      
+
       chdir $cwd or die "Cannot chdir() back to $cwd: $!";
     }
     eval "use Module::Build::Compat 0.02; 1" or die $@;
     
     Module::Build::Compat->run_build_pl(args => \@ARGV);
+    my $build_script = 'Build';
+    $build_script .= '.com' if $^O eq 'VMS';
+    exit(0) unless(-e $build_script); # cpantesters convention
     require Module::Build;
     Module::Build::Compat->write_makefile(build_class => 'Module::Build');
@@ -13,7 +13,8 @@ sub serialize {
 }
 
 sub deserialize {
-	return JSON->VERSION < 2 ? JSON->new->jsonToObj($_[1]) : JSON->new->decode($_[1]);
+	#return JSON->VERSION < 2 ? JSON->new->jsonToObj($_[1]) : JSON->new->decode($_[1]);
+	$_[1] and return JSON->VERSION < 2 ? JSON->new->jsonToObj($_[1]) : JSON->new->decode($_[1]);
 }
 
 1;
@@ -19,7 +19,7 @@ require Exporter;
 @EXPORT = qw( );
 @EXPORT_OK = qw( );
 
-$VERSION = '0.49';
+$VERSION = '0.51';
 
 # Preloaded methods go here.
 {
@@ -654,9 +654,10 @@ sub _dedigest {
   my $input = (shift);
   my $digester = (shift);
   $self->_module_loader('Digest');	
-  my ($old_digest) = $input =~ /^([^=]+?)=/;
+  #my ($old_digest) = $input =~ /^([^=]+?)=/;
+  $input =~ s/^([^=]+?)=//;
+  my $old_digest = $1;
   return undef unless (defined $old_digest);
-  $input =~ s/^$old_digest=//;
   my $new_digest = $self->_get_digest($input,$digester);
   return undef unless ($new_digest eq $old_digest);
   return $input;
@@ -55,3 +55,4 @@ foreach my $serializer (@serializers) {
         }
 }
 
+